Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

246
Views
JavaScript (glide.js) - Laravel Mix "type=module" needed and why?

I am using a Laravel application and Laravel Mix for asset building.

I was trying to use Glide.js this evening and did the following after installing glide.js via npm.

Within my resources/js/app.js file I have this contents:

require('./bootstrap');

import Glide from '@glidejs/glide'
new Glide('.glide').mount();

My webpack.mix.js filed which is compiled by Laravel Mix, looks like this:

mix.copyDirectory('resources/img', 'public/img')
    .js('resources/js/app.js', 'public/js')
    .version();

When I now load the frontend, my slider does not work - it throws an JS error : [Glide warn]: Root element must be a existing Html node

When I change my script tag from:

<script src="{{ mix src='js/app.js' }}"></script>

To

<script src="{{ mix src='js/app.js' }}" type="module"></script>

It works - but is this really necessary? I have never read about type=module in combination with mix. Is this always necessary once the main js has "import" statements?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!